package com.hr.controller;

import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//@Configuration  是错的
@Controller
public class HelloController {

    @RequestMapping("springmvc/hello")//对外访问的地址是handlerMapping注册的注解
    @ResponseBody//直接返字符串给前端，不要找视图解析器。
    public String hello(){
        System.out.println("HelloController.hello");
        //返回给前端的字符串
        return "hello springmvc";
    }

}
